package com.wffz.comm.idTools;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class AccessionNumberGen {

    private ShortSnowflakeGenerator shortSnowflakeGenerator = null;

    /**
     *  生成方法
     * @return
     */
    public Long generatorId() {
        return shortSnowflakeGenerator.generator();
    }

    /**
     *  初始化
     */
    @PostConstruct
    public void init() {
        shortSnowflakeGenerator = new ShortSnowflakeGenerator();
    }

}
